import request from '@/utils/request'
// ================赛事板块============================
export function getContestSpeciesList(){
    return request({
        url: '/api/v1.0/getContestSpeciesList',
        method: 'get'
        })
    }
export function addContestSpecies(params){
    return request({
        url: '/api/v1.0/addContestSpecies',
        method: 'post',
        params:params
        })
    }
export function deleteContestSpecies(params){
    return request({
        url: '/api/v1.0/deleteContestSpecies',
        method: 'delete',
        params:params
        })
    }
export function editContestSpecies(params){
    return request({
        url: `/api/v1.0/editContestSpecies?contestSpeciesId=${params.id}&contestSpeciesName=${params.name}`,
        method: 'post'
        })
    }
// ===============赛事信息===============================
export function getContestList(param){
    return request({
        url: '/api/v1.0/getContestList',
        method: 'get',
        params:param
    })
}
export function addContest(data){
    return request({
        url: '/api/v1.0/addContest',
        method: 'post',
        data:data
        })
    }
export function editContest(data){
    return request({
        url:'/api/v1.0/editContest',
        method:'POST',
        data:data
    })
}

export function removeContest(data){
    return request({
        url:'/api/v1.0/removeContest',
        method:'delete',
        params:data
    })
}
// ======================赛事公告===============================================
export function getContestNoticeList(params){
    return request({
        url:'/api/v1.0/getContestNoticeList',
        method:'GET',
        params:params
    })
}

export function addContestNotice(data){
    return request({
        url:'/api/v1.0/addContestNotice',
        method:'POST',
        data:data
    })
}
export function editContestNotice(data){
    return request({
        url:'/api/v1.0/editContestNotice',
        method:'POST',
        data:data
    })
}
export function deleteContestNotice(param){
    return request({
        url:'/api/v1.0/deleteContestNotice',
        method:'delete',
        params:param
    })
}
// =============参赛队伍管理=============================================
export function getTeamInfoList(param){
    return request({
        url:'/api/v1.0/getTeamInfoList',
        method:'get',
        params:param
    })
}
export function getTeamMembers(param){
    return request({
        url:'/api/v1.0/getTeamMembers',
        method:'get',
        params:param
    })
}
export function createTeam(data){
    return request({
        url:'/api/v1.0/createTeam',
        method:'post',
        data:data
    })
}
export function editTeam(data) {
    return request({
        url:'/api/v1.0/editTeam',
        method:'post',
        data:data
    })
}
export function joinTeam(data){
    return request({
        url:'/api/v1.0/joinTeam',
        method:'post',
        data:data
    })
}
export function kickOutMember(userId, teamId) {
    return request({
        url:`/api/v1.0/kickOutMember?teamId=${teamId}&userId=${userId}`,
        method:'delete'
    })
}

export function replaceCaptain(teamId, userId) {
    return request({
        url:`/api/v1.0/replaceCaptain?teamId=${teamId}&userId=${userId}`,
        method:'post'
    })
}

export function getOtherUserList(teamId) {
    return request({
        url:`/api/v1.0/getOtherUserList?teamId=${teamId}`,
        method:'get'
    })
}

export function addMember(userId, teamId) {
    return request({
        url:`/api/v1.0/addMember?teamId=${teamId}&userId=${userId}`,
        method:'post'
    })
}

export function getTeamList(param){
    return request({
        url:'/api/v1.0/getTeamList',
        method:'get',
        params:param
    })
}

export function getTeamListAsCaptain(param){
    return request({
        url:'/api/v1.0/getTeamListAsCaptain',
        method:'get',
        params:param
    })
}

export function exitTeam(teamId, userId) {
    return request({
        url:`/api/v1.0/exitTeam?teamId=${teamId}&userId=${userId}`,
        method:'post'
    })
}

export function getJoinMember(param){
    return request({
        url:'/api/v1.0/getJoinMember',
        method:'get',
        params:param
    })
}

export function reviewJoinRequset(advice,teamId,userId){
    return request({
        url:`/api/v1.0/reviewJoinRequset?advice=${advice}&teamId=${teamId}&userId=${userId}`,
        method:'post'
    })
}

export function getTeamNoticeList(param){
    return request({
        url:'/api/v1.0/getTeamNoticeList',
        method:'get',
        params:param
    })
}

export function editTeamNotice(data){
    return request({
        url:'/api/v1.0/editTeamNotice',
        method:'post',
        data:data
    })
}

export function removeTeamNotice(data){
    return request({
        url:'/api/v1.0/removeTeamNotice',
        method:'delete',
        params:data
    })
}

export function addTeamNotice(data){
    return request({
        url:'/api/v1.0/addTeamNotice',
        method:'post',
        data:data
    })
}
export function removeTeam(data){
    return request({
        url:'/api/v1.0/removeTeam',
        method:'delete',
        params:data
    })
}

export function getTeamName(data){
    return request({
        url:'/api/v1.0/getTeamName',
        method:'get',
        params:data
    })
}

export function readTeamNotice(noticeId, userId) {
    return request({
        url: `/api/v1.0/readTeamNotice?userId=${userId}&noticeId=${noticeId}`,
        method:'post'
    })
}

export function getTeamNoticeStatusList(teamId, userId) {
    return request({
        url: `/api/v1.0/getTeamNoticeStatusList?userId=${userId}&teamId=${teamId}`,
        method:'get'
    })
}

export function getReadStatus(noticeId) {
    return request({
        url: `/api/v1.0/getReadStatus?noticeId=${noticeId}`,
        method:'get'
    })
}

export function getUserList(){
    return request({
        url: '/api/v1.0/getUserList',
        method:'get'
    })
}